package evolutionaryballoons.behavior.genetic;

import evolutionaryballoons.Balloon;
import evolutionaryballoons.Currents;
import evolutionaryballoons.Points;
import evolutionaryballoons.behavior.Behavior;

public class GeneticBehavior implements Behavior {
	private Node rootNode;
	private NodeInterface nodeInterface;
	
	public GeneticBehavior(Balloon balloon, Points points, Currents currents, Node rootNode) {
		DataProvider dataProvider = new DataProvider(balloon, points, currents);
		this.nodeInterface = new NodeInterface();
		this.nodeInterface.balloon = balloon;
		this.nodeInterface.dataProvider = dataProvider;
		this.nodeInterface.points = points;
		
		this.rootNode = rootNode;
	}
	
	@Override
	public void act() {
		rootNode.perform(nodeInterface);
	}

}
